{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Numina Olympiad Problems"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Extract AMC Data from numina\n",
    "import json\n",
    "from concurrent.futures import as_completed\n",
    "\n",
    "from datasets import load_dataset\n",
    "from tqdm import tqdm\n",
    "\n",
    "ds = load_dataset(\"AI-MO/NuminaMath-CoT\")\n",
    "# Filter for amc_aime problems\n",
    "olympiad = ds[\"train\"].filter(lambda x: x[\"source\"] == \"olympiads\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Filter for non-proof problems."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      " You see a square resembling a chessboard that is divided into 4 parts. Can you arrange these parts in such a way that the new figure has one less cell, i.e., 63 cells?\n",
      "3\n",
      " How to easily and accurately remember the formulas for the sine and cosine of angles:\n",
      "\n",
      "$$\n",
      "\\frac{\\pi}{2} \\pm \\alpha ; \\pi \\pm \\alpha ; \\frac{3 \\pi}{2} \\pm \\alpha, 2 \\pi - \\alpha ?\n",
      "$$\n",
      "3\n",
      " In one glass, there was milk, and in another - the same amount of coffee. A spoonful was transferred from the glass of milk to the glass of coffee and mixed. Then, the same spoonful of the mixture was transferred back to the glass with milk. What is there more of now: coffee in the glass with milk or milk in the glass with coffee?\n",
      "3\n",
      " Cut a triangle into two parts, which can be reassembled into a 20-sided polygon.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit: \n",
      " 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details. \n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit: \n",
      " 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit: \n",
      " 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  Retry due to rate limit: 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details. \n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  Retry due to rate limit: 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details. \n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  Retry due to rate limit: 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details. \n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit:  \n",
      "429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit: \n",
      "  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit: \n",
      " 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.Retry due to rate limit: \n",
      " 429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit: Retry due to rate limit:   429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "Retry due to rate limit:  429 Resource exhausted. Please try again later. Please refer to https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429 for more details.\n",
      "3\n",
      " Provide at least two different arguments that could justify the interest of the Central Bank of the Russian Federation in using the described loyalty program. Justify your assumptions.\n",
      "\n",
      "Provide at least two different arguments justifying the benefits for banks whose clients' cards participate in such a loyalty program. Justify your assumptions.\n",
      "\n",
      "Why do you think that despite the wide range of various bonuses for customers and a large number of participating companies, the payment system requires registration of the \"Mir\" cards? Why not provide the ability for all holders of this payment system's cards to receive these bonuses? Justify your assumptions using economic arguments.\n",
      "3\n",
      " \n",
      "(a) To which class (type) of goods (services) can the described service (complete apartment renovation) be attributed? Explain why. What are the characteristics that it has (as opposed to typical consumer goods and services)? Explain.\n",
      "\n",
      "(b) The decision between a private repair crew and a construction company was difficult for the family. Give two economically reasoned arguments \"for\" and \"against\" using a construction company or a private repair crew to carry out the planned renovation. (Note: if you provide more than two arguments \"for\" or \"against,\" only the first two of each pair will be evaluated).\n",
      "3\n",
      " In the convex pentagon \\(ABCDE\\), the angles \\(\\angle CAB\\) and \\(\\angle BCA\\) are equal. The midpoint of \\(BD\\) lies on \\(CE\\).\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Processing entries: 100%|██████████| 102270/102270 [00:00<00:00, 104646.63it/s]\n"
     ]
    }
   ],
   "source": [
    "# Filter for non-proof problems.\n",
    "import concurrent.futures\n",
    "\n",
    "from rllm.system_prompts import FILTER_PROOF_PROMPT\n",
    "from rllm.utils import call_gemini_llm\n",
    "\n",
    "\n",
    "def process_entry(entry):\n",
    "    output_dict = {}\n",
    "    # 1) Get the problem text\n",
    "    problem_text = entry[\"problem\"]\n",
    "    solution_text = entry[\"solution\"]\n",
    "    # 2) Call Gemini LLM\n",
    "    output_str = call_gemini_llm(f\"Problem: {problem_text} \\n\\n Solution: {solution_text}\", system_prompt=FILTER_PROOF_PROMPT)\n",
    "    if not output_str:\n",
    "        print(\"Gemini not happy.\")\n",
    "        return None\n",
    "    if \"[[2]]\" in output_str:\n",
    "        output_dict[\"problem\"] = entry[\"problem\"]\n",
    "        output_dict[\"solution\"] = entry[\"solution\"]\n",
    "        return {\n",
    "            \"problem\": entry[\"problem\"],\n",
    "            \"solution\": entry[\"solution\"],\n",
    "        }\n",
    "    else:\n",
    "        if \"[[3]]\" in output_str:\n",
    "            print(output_str, entry[\"problem\"])\n",
    "    return output_dict\n",
    "\n",
    "\n",
    "# Suppose `olympiad` is your list of dictionaries\n",
    "subset = olympiad\n",
    "results = []\n",
    "\n",
    "with concurrent.futures.ProcessPoolExecutor(max_workers=48) as executor:\n",
    "    # 1) Submit all jobs to the executor\n",
    "    futures = [executor.submit(process_entry, entry) for entry in subset]\n",
    "\n",
    "# 2) Process them as they complete, using tqdm for a progress bar\n",
    "for future in tqdm(as_completed(futures), total=len(futures), desc=\"Processing entries\"):\n",
    "    # Get the result for each completed future\n",
    "    result = future.result()\n",
    "    if result:\n",
    "        results.append(result)\n",
    "\n",
    "\n",
    "# Save final list as json\n",
    "with open(\"olympiad_no_proof.json\", \"w\") as f:\n",
    "    json.dump(results, f, indent=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Filter for Unique Olympiad Problems (outside of Omni_Math)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/envs/rllm/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "\n",
    "from rllm.utils import RAG\n",
    "\n",
    "with open(\"olympiad_no_proof.json\", encoding=\"utf-8\") as f:\n",
    "    olympiad_data = json.load(f)\n",
    "\n",
    "with open(\"../raw/train/omni_math.json\", encoding=\"utf-8\") as f:\n",
    "    omni_data = json.load(f)\n",
    "\n",
    "rag_searcher = RAG(docs=[d[\"problem\"] for d in omni_data])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   1%|          | 1016/102125 [00:07<12:49, 131.44it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   2%|▏         | 2021/102125 [00:15<12:46, 130.56it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   3%|▎         | 3015/102125 [00:23<12:37, 130.76it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   4%|▍         | 4023/102125 [00:30<12:26, 131.48it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   5%|▍         | 5017/102125 [00:38<12:16, 131.78it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   6%|▌         | 6025/102125 [00:46<12:07, 132.02it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   7%|▋         | 7019/102125 [00:53<11:59, 132.16it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   8%|▊         | 8027/102125 [01:01<11:46, 133.16it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:   9%|▉         | 9021/102125 [01:08<11:41, 132.69it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  10%|▉         | 10015/102125 [01:16<11:33, 132.81it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  11%|█         | 11023/102125 [01:24<11:25, 132.84it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  12%|█▏        | 12017/102125 [01:31<11:19, 132.60it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  13%|█▎        | 13025/102125 [01:39<11:14, 132.12it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  14%|█▎        | 14019/102125 [01:46<11:07, 132.05it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "14000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  15%|█▍        | 15013/102125 [01:54<11:00, 131.93it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  16%|█▌        | 16021/102125 [02:01<10:51, 132.10it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  17%|█▋        | 17015/102125 [02:09<10:42, 132.38it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "17000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  18%|█▊        | 18023/102125 [02:17<10:38, 131.76it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  19%|█▊        | 19017/102125 [02:24<10:28, 132.30it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  20%|█▉        | 20025/102125 [02:32<10:24, 131.38it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "20000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  21%|██        | 21019/102125 [02:39<10:13, 132.11it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "21000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  22%|██▏       | 22013/102125 [02:47<10:06, 132.10it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "22000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  23%|██▎       | 23021/102125 [02:55<09:59, 131.91it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "23000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  24%|██▎       | 24015/102125 [03:02<09:51, 132.12it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "24000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  25%|██▍       | 25023/102125 [03:10<09:43, 132.22it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "25000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  25%|██▌       | 26017/102125 [03:17<09:37, 131.78it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  26%|██▋       | 27025/102125 [03:25<09:29, 131.80it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "27000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  27%|██▋       | 28019/102125 [03:32<09:19, 132.56it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "28000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  28%|██▊       | 29027/102125 [03:40<09:07, 133.61it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "29000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  29%|██▉       | 30021/102125 [03:48<09:08, 131.48it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "30000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  30%|███       | 31015/102125 [03:55<09:00, 131.59it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "31000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  31%|███▏      | 32023/102125 [04:03<08:50, 132.27it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "32000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  32%|███▏      | 33017/102125 [04:10<08:42, 132.27it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "33000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  33%|███▎      | 34025/102125 [04:18<08:36, 131.95it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "34000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  34%|███▍      | 35019/102125 [04:25<08:26, 132.51it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "35000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  35%|███▌      | 36013/102125 [04:33<08:19, 132.47it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "36000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  36%|███▋      | 37021/102125 [04:41<08:11, 132.45it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "37000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  37%|███▋      | 38015/102125 [04:48<08:08, 131.15it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "38000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  38%|███▊      | 39023/102125 [04:56<07:57, 132.08it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "39000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  39%|███▉      | 40017/102125 [05:03<07:48, 132.60it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "40000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  40%|████      | 41025/102125 [05:11<07:44, 131.52it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "41000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  41%|████      | 42018/102125 [05:18<08:36, 116.48it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "42000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  42%|████▏     | 43026/102125 [05:26<07:29, 131.38it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "43000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  43%|████▎     | 44020/102125 [05:34<07:19, 132.30it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "44000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  44%|████▍     | 45014/102125 [05:41<07:11, 132.23it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "45000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  45%|████▌     | 46022/102125 [05:49<07:02, 132.73it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "46000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  46%|████▌     | 47016/102125 [05:56<06:56, 132.21it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "47000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  47%|████▋     | 48024/102125 [06:04<06:48, 132.57it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "48000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  48%|████▊     | 49018/102125 [06:11<06:40, 132.57it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "49000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  49%|████▉     | 50026/102125 [06:19<06:33, 132.37it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "50000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  50%|████▉     | 51020/102125 [06:27<06:25, 132.47it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "51000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  51%|█████     | 52014/102125 [06:34<06:17, 132.67it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "52000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  52%|█████▏    | 53022/102125 [06:42<06:11, 132.13it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "53000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  53%|█████▎    | 54016/102125 [06:49<06:00, 133.35it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "54000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  54%|█████▍    | 55024/102125 [06:57<05:54, 132.78it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "55000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  55%|█████▍    | 56018/102125 [07:04<05:48, 132.48it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "56000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  56%|█████▌    | 57026/102125 [07:12<05:39, 132.88it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "57000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  57%|█████▋    | 58020/102125 [07:19<05:30, 133.55it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "58000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  58%|█████▊    | 59014/102125 [07:27<05:24, 132.95it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "59000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  59%|█████▉    | 60022/102125 [07:35<05:18, 132.22it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "60000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  60%|█████▉    | 61016/102125 [07:42<05:10, 132.35it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "61000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  61%|██████    | 62024/102125 [07:50<05:04, 131.74it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "62000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  62%|██████▏   | 63018/102125 [07:57<04:55, 132.40it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "63000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  63%|██████▎   | 64026/102125 [08:05<04:47, 132.71it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "64000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  64%|██████▎   | 65020/102125 [08:12<04:40, 132.33it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "65000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  65%|██████▍   | 66014/102125 [08:20<04:31, 132.97it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "66000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  66%|██████▌   | 67021/102125 [08:28<04:24, 132.94it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "67000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  67%|██████▋   | 68015/102125 [08:35<04:20, 130.81it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "68000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  68%|██████▊   | 69023/102125 [08:43<04:09, 132.66it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "69000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  69%|██████▊   | 70017/102125 [08:50<04:02, 132.46it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "70000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  70%|██████▉   | 71025/102125 [08:58<03:50, 134.84it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "71000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  71%|███████   | 72019/102125 [09:05<03:47, 132.09it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "72000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  71%|███████▏  | 73013/102125 [09:13<03:40, 131.85it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "73000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  72%|███████▏  | 74021/102125 [09:20<03:31, 132.70it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "74000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  73%|███████▎  | 75015/102125 [09:28<03:26, 131.53it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "75000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  74%|███████▍  | 76023/102125 [09:36<03:18, 131.47it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "76000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  75%|███████▌  | 77017/102125 [09:43<03:09, 132.65it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "77000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  76%|███████▋  | 78025/102125 [09:51<03:01, 132.65it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "78000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  77%|███████▋  | 79019/102125 [09:58<02:53, 132.80it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "79000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  78%|███████▊  | 80013/102125 [10:06<02:47, 132.22it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "80000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  79%|███████▉  | 81021/102125 [10:13<02:40, 131.63it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "81000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  80%|████████  | 82015/102125 [10:21<02:31, 132.79it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "82000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  81%|████████▏ | 83023/102125 [10:29<02:23, 132.75it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "83000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  82%|████████▏ | 84017/102125 [10:36<02:16, 132.29it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "84000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  83%|████████▎ | 85025/102125 [10:44<02:09, 132.54it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "85000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  84%|████████▍ | 86019/102125 [10:51<02:01, 132.41it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "86000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  85%|████████▌ | 87013/102125 [10:59<01:54, 132.03it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "87000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  86%|████████▌ | 88021/102125 [11:06<01:46, 132.97it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "88000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  87%|████████▋ | 89015/102125 [11:14<01:38, 132.54it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "89000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  88%|████████▊ | 90023/102125 [11:21<01:32, 130.94it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "90000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  89%|████████▉ | 91017/102125 [11:29<01:24, 132.20it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "91000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  90%|█████████ | 92025/102125 [11:37<01:16, 131.85it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "92000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  91%|█████████ | 93019/102125 [11:44<01:09, 131.74it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "93000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  92%|█████████▏| 94013/102125 [11:52<01:01, 131.98it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "94000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  93%|█████████▎| 95021/102125 [11:59<00:53, 132.43it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "95000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  94%|█████████▍| 96015/102125 [12:07<00:46, 130.87it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "96000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  95%|█████████▌| 97023/102125 [12:14<00:38, 132.18it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "97000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  96%|█████████▌| 98017/102125 [12:22<00:30, 132.71it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "98000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  97%|█████████▋| 99025/102125 [12:30<00:23, 130.72it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  98%|█████████▊| 100019/102125 [12:37<00:15, 132.58it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data:  99%|█████████▉| 101013/102125 [12:44<00:08, 132.34it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "101000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data: 100%|█████████▉| 102021/102125 [12:52<00:00, 132.25it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "102000\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Filtering olympiad data: 100%|██████████| 102125/102125 [12:53<00:00, 132.05it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2491"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Filter for olympiad problems that are not in the omni dataset\n",
    "from tqdm import tqdm\n",
    "\n",
    "filter_olympiad = []\n",
    "num_problems = 0\n",
    "\n",
    "counter = 0\n",
    "# Wrap olympiad_data with tqdm, optionally adding a description and total\n",
    "for d in tqdm(olympiad_data, desc=\"Filtering olympiad data\", total=len(olympiad_data)):\n",
    "    search_result = rag_searcher.top_k(d[\"problem\"], k=1)[0]\n",
    "    score = search_result[\"score\"]\n",
    "    if score > 0.93:\n",
    "        num_problems += 1\n",
    "    else:\n",
    "        filter_olympiad.append(d)\n",
    "    counter += 1\n",
    "    if counter % 1000 == 0:\n",
    "        print(counter)\n",
    "# Save final list as json\n",
    "with open(\"olympiad_unique.json\", \"w\") as f:\n",
    "    json.dump(filter_olympiad, f, indent=2)\n",
    "num_problems"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Extract Answers from each Problem"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "\n",
    "# Process dataset to prpoduce answers\n",
    "with open(\"olympiad_no_proof.json\", encoding=\"utf-8\") as f:\n",
    "    olympiad = json.load(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/envs/rllm/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1000\n",
      "2000\n",
      "3000\n",
      "4000\n",
      "5000\n",
      "6000\n",
      "7000\n",
      "8000\n",
      "9000\n",
      "10000\n",
      "11000\n",
      "12000\n",
      "13000\n",
      "14000\n",
      "15000\n",
      "16000\n",
      "17000\n",
      "18000\n",
      "19000\n",
      "20000\n",
      "21000\n",
      "22000\n",
      "23000\n",
      "24000\n",
      "25000\n",
      "23 seats are available in a line. Customers enter and leave singly or in pairs. If two customers enter together then they leave together. There are never more than 16 customers present. How should the customers be seated so that pairs can always be given adjacent seats (without any customer ever having to change his seat)?\n",
      "\n",
      "We need to arrange the 23 seats in such a way that pairs of customers can always be given adjacent seats, without any customer ever having to change their seat, even if there are never more than 16 customers present at once.\n",
      "\n",
      "1. **Divide the seats**:\n",
      "   - Split the 23 seats into 7 groups of 3 adjacent seats each and one pair of adjacent seats. This grouping can be visualized as:\n",
      "   $$\n",
      "   (1, 2, 3), (4, 5, 6), (7, 8, 9), (10, 11, 12), (13, 14, 15), (16, 17, 18), (19, 20, 21), (22, 23).\n",
      "   $$\n",
      "   \n",
      "2. **Seating Constraint for Singles**:\n",
      "   - Never seat a single customer in the center of any group of three. That is, in each triplet (like `(1, 2, 3)`), singles can only sit in positions 1 or 3, but not in position 2.\n",
      "   \n",
      "3. **Arriving Single Customer**:\n",
      "   - If a single customer arrives and all seats are not already occupied:\n",
      "     - We first count the available seats: since each non-central seat can contain a single customer and there are 16 such seats (since each of the 7 triplets provides 2 non-central seats and there is one pair), if there are fewer than 16 customers, there must be at least one non-central seat available.\n",
      "   \n",
      "4. **Arriving Pair of Customers**:\n",
      "   - When a pair arrives, they need two adjacent seats.\n",
      "   - Consider the current scenario:\n",
      "     - If there are already 14 customers present, this implies we have potentially 7 groups that could each be partially filled:\n",
      "       - If any of the groups `(x, y, z)` has its two seats occupied in positions 1 and 2 or 2 and 3 or remains empty (which will be unlikely for 14):\n",
      "         - There must be an empty adjacent pair of any of these groups.\n",
      "         - If no such available pair, specifically, groups `(22, 23)` must be empty for at least one pair seat availability.\n",
      "\n",
      "5. **Prevention of Blocking**:\n",
      "   - Ensure no blockage occurs by preventing a split of paired arrivals when 16 customers are present; guaranteeing a system where groups handle both indivisible reaches the goal pairwise accommodating every arrival without the empty middle of any trip.\n",
      "\n",
      "### Conclusion:\n",
      "\n",
      "By ensuring such a seating arrangement and rules for single vs. pair seatings, pairs of customers will always have adjacent seats available without requiring any existing customer to move.\n",
      "\n",
      "$\\boxed{}$\n",
      "26000\n",
      "27000\n",
      "28000\n",
      "Someone claims that by adding 10 to the sum $(n-1)^{4} + n^{4} + (n+1)^{4}$, where $n$ is an integer, we reach the nearest natural number that is equal to three times a perfect square. Is their claim true?\n",
      "\n",
      "1. First, we need to expand and simplify the given expressions \\((n-1)^4\\) and \\((n+1)^4\\).\n",
      "    \\[\n",
      "    \\begin{array}{l}\n",
      "    (n-1)^4 = \\left(n^2 - 2n + 1\\right)^2 \\\\\n",
      "    \\quad = n^4 - 4n^3 + 6n^2 - 4n + 1\n",
      "    \\end{array}\n",
      "    \\]\n",
      "    \\[\n",
      "    \\begin{array}{l}\n",
      "    (n+1)^4 = \\left(n^2 + 2n + 1\\right)^2 \\\\\n",
      "    \\quad = n^4 + 4n^3 + 6n^2 + 4n + 1\n",
      "    \\end{array}\n",
      "    \\]\n",
      "\n",
      "2. Next, we calculate the sum \\(S = (n-1)^4 + n^4 + (n+1)^4\\):\n",
      "   \\[\n",
      "   S = (n^4 - 4n^3 + 6n^2 - 4n + 1) + n^4 + (n^4 + 4n^3 + 6n^2 + 4n + 1)\n",
      "   \\]\n",
      "   \n",
      "3. Combine like terms:\n",
      "   \\[\n",
      "   S = 3n^4 + 12n^2 + 2\n",
      "   \\]\n",
      "\n",
      "4. Add 10 to the sum \\(S\\):\n",
      "   \\[\n",
      "   S + 10 = 3n^4 + 12n^2 + 2 + 10\n",
      "   \\]\n",
      "\n",
      "5. Simplify the resulting expression:\n",
      "   \\[\n",
      "   S + 10 = 3n^4 + 12n^2 + 12\n",
      "   \\]\n",
      "   \\[\n",
      "   S + 10 = 3(n^4 + 4n^2 + 4) \n",
      "   \\]\n",
      "\n",
      "6. Recognize that the expression inside the parentheses is a perfect square:\n",
      "   \\[\n",
      "   S + 10 = 3(n^2 + 2)^2\n",
      "   \\]\n",
      "\n",
      "7. Since \\((n^2 + 2)^2\\) is a square of an integer, \\(3(n^2 + 2)^2\\) is indeed three times a square of an integer.\n",
      "\n",
      "8. To prove the correctness for all integers \\(n\\), consider the previous value \\(3(n^2 + 1)^2\\) and check if this is smaller than or equal to \\(S\\):\n",
      "   \\[\n",
      "   S \\geq 3(n^2 + 1)^2\n",
      "   \\]\n",
      "   \\[\n",
      "   3n^4 + 12n^2 + 2 \\geq 3(n^2 + 1)^2\n",
      "   \\]\n",
      "   \\[\n",
      "   3n^4 + 12n^2 + 2 \\geq 3n^4 + 6n^2 + 3\n",
      "   \\]\n",
      "   \\[\n",
      "   6n^2 \\geq 1\n",
      "   \\]\n",
      "\n",
      "9. The inequality \\(6n^2 \\geq 1\\) holds for all non-zero integers \\(n\\). However, \\(n = 0\\) does not satisfy the condition.\n",
      "\n",
      "10. Since \\(n = 0\\) is an exception, and it doesn't satisfy the property stated in the initial claim, the statement isn’t true for all integers.\n",
      "\n",
      "**Conclusion:** The assertion is not correct in the form “for all integers”, but it becomes correct if rephrased to “for all non-zero integers” or “for all natural numbers”. Thus, the assertion is only valid for non-zero integers.\n",
      "\n",
      "\\[\n",
      "\\blacksquare\n",
      "\\]\n",
      "29000\n",
      "30000\n",
      "31000\n",
      "32000\n",
      "33000\n",
      "34000\n",
      "35000\n",
      "36000\n",
      "37000\n",
      "38000\n",
      "39000\n",
      "40000\n",
      "41000\n",
      "42000\n",
      "43000\n",
      "44000\n",
      "45000\n",
      "46000\n",
      "47000\n",
      "48000\n",
      "49000\n",
      "50000\n",
      "51000\n",
      "52000\n",
      "53000\n",
      "54000\n",
      "55000\n",
      "56000\n",
      "57000\n",
      "58000\n",
      "59000\n",
      "60000\n",
      "61000\n",
      "Find all integers which are the sum of the squares of their four smallest positive divisors.\n",
      "Let's start by delineating the conditions and steps to find all integers \\( n \\) which are the sum of the squares of their four smallest positive divisors:\n",
      "\n",
      "\n",
      "1. **Observation on Odd and Even Values of \\( n \\):**\n",
      "\n",
      "    - If \\( n \\) is odd, then its four smallest divisors would also be odd. The sum of the squares of these odd divisors would be odd. However, the problem requires \\( n \\) to be equal to this sum. Hence, this contradicts the parity of \\( n \\) being odd. Therefore, \\( n \\) cannot be odd and must be even.\n",
      "\n",
      "2. **Determining if \\( 2 \\mid n \\):**\n",
      "    \n",
      "    - As \\( n \\) is even, the smallest divisor is \\( 1 \\) and the next smallest is \\( 2 \\). Now, let's consider cases where higher powers of \\( 2 \\) divide \\( n \\).\n",
      "\n",
      "3. **Case \\( n \\) Divisible by \\( 4 \\):**\n",
      "\n",
      "    - Assume \\( 4 \\mid n \\). The four smallest divisors can either be \\( 1, 2, 4, 8 \\), or \\( 1, 2, 4, p \\), where \\( p \\) is an odd prime divisor of \\( n \\).\n",
      "    \n",
      "    - For the first case (divisors \\( 1, 2, 4, 8 \\)):\n",
      "        \\[\n",
      "        1^2 + 2^2 + 4^2 + 8^2 = 1 + 4 + 16 + 64 = 85,\n",
      "        \\]\n",
      "        which is odd. Thus, this cannot be \\( n \\) since \\( n \\) is even.\n",
      "    \n",
      "    - For the second case (divisors \\( 1, 2, 4, p \\)):\n",
      "        - Assume \\( 4pm \\mid n \\) and write:\n",
      "        \\[\n",
      "        1^2 + 2^2 + 4^2 + p^2 = 21 + p^2.\n",
      "        \\]\n",
      "        For \\( n \\) to be even, \\( 21 + p^2 \\) must be an even number. This system suggests divisors must divide each other to some degree. Given \\( 21 \\equiv 1 \\pmod{4} \\), \n",
      "            \\[\n",
      "            1 + p^2 \\equiv 0 \\pmod{4},\n",
      "            \\]\n",
      "            leading to potential values \\( p \\equiv 3 \\mod 4 \\), but further check excludes \\( 3, 7, 11, etc.\\)\n",
      "\n",
      "4. **Simplified Case: \\( n \\) Divisible by \\( 2 \\) Only:**\n",
      "\n",
      "    - Now assume \\( 4 \\nmid n \\). Then, \\( n = 2k \\) where \\( k \\) so that the smallest odd prime \\( p \\) divides \\( n\\). The smallest divisors are \\( 1, 2, p, 2p \\):\n",
      "    \n",
      "    - Sum of their squares:\n",
      "        \\[\n",
      "        1^2 + 2^2 + p^2 + (2p)^2 = 1 + 4 + p^2 + 4p^2 = 5 + 5p^2.\n",
      "        \\]\n",
      "\n",
      "    - Assume \\( n = 2p \\) then; \\( 5 + 5p^2 = 2pm \\implies (1 + p^2) = 2pm = \\frac{1 + p^2}{5} = 2pm.\n",
      "\n",
      "\n",
      "    - Evaluating the simplest prime cases,\n",
      "        - Let \\( p = 3 \\): Try full combinations if they satisfy.\n",
      "\n",
      "        - Finally for \n",
      "            Find integer verifying full mentioned criteria.. \n",
      "\n",
      "    - \\\\boxed final answer\\.\n",
      "A rectangular grid of size $6 \\times 7$ is drawn on a sheet of graph paper. Cut it along the grid lines into 5 squares.\n",
      "\n",
      "1.  Start by recognizing that the goal is to divide a $6 \\times 7$ rectangle into 5 squares.\n",
      "2.  The total area of the rectangle is $6 \\times 7 = 42$ square units.\n",
      "3.  We will divide the $42$ square units into 5 squares. Observing the numbers, we can anticipate the sizes of these squares as adding up to 42.\n",
      "4.  Trying $3\\times3=9$, $2\\times2=4$, and $1\\times1=1$ will help us build the total.\n",
      "5.  We suspect that three significant sizes may help us, like three $3\\times3$ squares, one $2\\times2$ square, and four $1\\times1$ squares should sum to the total area.\n",
      "\n",
      "Let's verify our approach:\n",
      "   - $\\text{(3)}^2 = 9$\n",
      "   - $\\text{(2)}^2 = 4$\n",
      "   - $\\text{(1)}^2 = 1$\n",
      "   \n",
      "   - \\[\n",
      "     9 + 9 + 9 + 4 + 1 + 1 + 1 + 1 = 42 \n",
      "     \\]\n",
      "      \n",
      "6. Therefore, we can draw the division as:\n",
      "   - One $3\\times3$ square on top to bottom.\n",
      "   - One $3\\times3$ square below the first one to the middle left end.\n",
      "   - Another $3\\times3$ square below those squares leading right end.\n",
      "   - One $2\\times2$ square bottom middle.\n",
      "   - Four $1\\times1$ squares filling the lower side spaces.\n",
      "\n",
      "So, the calculation checks out. We can divide the $6\\times7$ rectangle into five squares by arranging three $3\\times3$, one $2\\times2$, and one's to balance the entire rectangle.\n",
      "\n",
      "Conclusion:\n",
      "\\[\n",
      "\\boxed{\\text{Example illustrated in the provided image meets the criteria with 3 squares similar sizes accordingly}}\n",
      "\\]\n",
      "\n",
      "62000\n",
      "A numerical sequence consists only of ones and zeros. If every element at an odd position is removed, the remaining elements form the exact same numerical sequence.\n",
      "\n",
      "Provide examples of such sequences. Additionally, provide examples of sequences with the same property when elements at even positions are removed.\n",
      "\n",
      "1. Let's first analyze the sequences where removing the elements at odd positions results in exactly the same sequence. Consider the following sequence:\n",
      "   \\[\n",
      "   1, 1, 0, 1, 1, 0, 1, 1, 0, \\ldots\n",
      "   \\]\n",
      "   To check this, we remove the elements at the odd positions:\n",
      "   \\[\n",
      "   1, 1, 0, 1, 1, 0, 1, 1, 0, \\ldots \\implies 1, 0, 1, 1, 1, 0, \\ldots\n",
      "   \\]\n",
      "   Thus, the resulting sequence is the same as the starting sequence, confirming that it satisfies the condition.\n",
      "\n",
      "   Another sequence with a similar property is:\n",
      "   \\[\n",
      "   1, 1, 1, 1, 0, 1, 1, 1, 1, 0, \\ldots\n",
      "   \\]\n",
      "   Removing the elements at odd positions:\n",
      "   \\[\n",
      "   1, 1, 1, 1, 0, 1, 1, 1, 1, \\ldots \\implies 1, 1, 1, 0, 1, 1, 1, \\ldots\n",
      "   \\]\n",
      "   This resulting sequence matches the original sequence. Therefore, it also satisfies the condition.\n",
      "\n",
      "2. Now, let's consider sequences from which removing elements at even positions results in a sequence identical to the original one. For example:\n",
      "   \\[\n",
      "   1, 0, 0, 1, 0, 0, 1, 0, 0, \\ldots\n",
      "   \\]\n",
      "   Removing the elements at even positions:\n",
      "   \\[\n",
      "   1, 0, 0, 1, 0, 0, 1, \\ldots \\implies 1, 0, 1, 0, 1, 0, \\ldots\n",
      "   \\]\n",
      "   This resulting sequence again matches the original sequence.\n",
      "\n",
      "   Another example is:\n",
      "   \\[\n",
      "   1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, \\ldots\n",
      "   \\]\n",
      "   Removing the elements at even positions:\n",
      "   \\[\n",
      "   1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, \\ldots \\implies 1, 0, 1, 0, 1, 1, 0, 1, \\ldots\n",
      "   \\]\n",
      "   This resulting sequence matches the original one as well.\n",
      "\n",
      "### Conclusion:\n",
      "\n",
      "The sequences that maintain their structure after removal of elements at odd or even indexed positions are:\n",
      "1. \\[\n",
      "   1, 1, 0, 1, 1, 0, 1, 1, 0, \\ldots\n",
      "   \\]\n",
      "   \\[\n",
      "   1, 1, 1, 1, 0, 1, 1, 1, 1, 0, \\ldots\n",
      "   \\]\n",
      "\n",
      "2. \\[\n",
      "   1, 0, 0, 1, 0, 0, 1, 0, 0, \\ldots\n",
      "   \\]\n",
      "   \\[\n",
      "   1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, \\ldots\n",
      "   \\]\n",
      "\n",
      "$\\boxed{}$\n",
      "63000\n",
      "64000\n",
      "65000\n",
      "66000\n",
      "67000\n",
      "68000\n",
      "69000\n",
      "70000\n",
      "We are given a positive integer \\( r \\) and a rectangular board divided into \\( 20 \\times 12 \\) unit squares. The following moves are permitted on the board: one can move from one square to another only if the distance between the centers of the two squares is \\( \\sqrt{r} \\). The task is to find a sequence of moves leading between two adjacent corners of the board which lie on the long side.\n",
      "\n",
      "(a) Show that the task cannot be done if \\( r \\) is divisible by 2 or 3.\n",
      "\n",
      "(b) Prove that the task is possible for \\( r = 73 \\).\n",
      "\n",
      "(c) Can the task be done for \\( r = 97 \\)?\n",
      "\n",
      "We are given a positive integer \\( r \\) and a rectangular board divided into \\( 20 \\times 12 \\) unit squares. We are to show whether it is possible or not to move from one square to another based on the given conditions.\n",
      "\n",
      "#### Part (a):\n",
      "Show that the task cannot be done if \\( r \\) is divisible by 2 or 3.\n",
      "\n",
      "1. Suppose the move is \\( a \\) units in one direction and \\( b \\) in the orthogonal direction. Then, the distance moved is given by:\n",
      "    \\[\n",
      "    \\sqrt{a^2 + b^2} = \\sqrt{r}\n",
      "    \\]\n",
      "   Therefore, we have:\n",
      "    \\[\n",
      "    a^2 + b^2 = r\n",
      "    \\]\n",
      "\n",
      "2. **If \\( r \\) is divisible by 2**:\n",
      "   - \\( a \\) and \\( b \\) must either both be even or both be odd. This follows because \\( a^2 \\) and \\( b^2 \\) must both be congruent to 0 (mod 4) if both are even, or both congruent to 1 (mod 4) if both are odd.\n",
      "   - This results in moves only accessing squares that are either all black or all white in a checkerboard pattern. \n",
      "\n",
      "     Let's assume the board is colored like a checkerboard. The two adjacent corners (start at \\((0,0)\\) and finish at \\((19,0)\\)) are different colors in a checkerboard pattern.\n",
      "\n",
      "   - Since the two corners are of opposite parity, it is impossible to reach one from the other because our moves only allow access to squares of the same color. \n",
      "\n",
      "3. **If \\( r \\) is divisible by 3**:\n",
      "   - Since all squares are congruent to 0 or 1 modulo 3, \\( a \\) and \\( b \\) must both be multiples of 3.\n",
      "   - This means that any move will only transfer the position to coordinates of the form \\((3m, 3n)\\). Essentially, the movements are restricted to multiples of 3.\n",
      "   \n",
      "   - Starting at \\((0,0)\\) and aiming for \\((19,0)\\), but \\((19,0)\\) is not of the form \\((3m, 3n)\\). Hence, it's impossible.\n",
      "\n",
      "Therefore, we conclude that the task cannot be done if \\( r \\) is divisible by 2 or 3.\n",
      "\n",
      "\\[\n",
      "\\blacksquare\n",
      "\\]\n",
      "\n",
      "#### Part (b):\n",
      "Prove that the task is possible for \\( r = 73 \\).\n",
      "\n",
      "1. If \\( r = 73 \\), then we need \\( a \\) and \\( b \\) such that:\n",
      "    \\[\n",
      "    a^2 + b^2 = 73\n",
      "    \\]\n",
      "\n",
      "2. Noting that:\n",
      "    \\[\n",
      "    8^2 + 3^2 = 64 + 9 = 73\n",
      "    \\]\n",
      "\n",
      "   Thus, the possible moves are \\((8,3)\\), \\((3,8)\\), \\((8,-3)\\), \\((3,-8)\\), and their corresponding negatives.\n",
      "\n",
      "3. We define four types of moves:\n",
      "   - Type A: \\((x,y) \\rightarrow (x+8, y+3)\\)\n",
      "   - Type B: \\((x,y) \\rightarrow (x+3, y+8)\\)\n",
      "   - Type C: \\((x,y) \\rightarrow (x+8, y-3)\\)\n",
      "   - Type D: \\((x,y) \\rightarrow (x+3, y-8)\\)\n",
      "\n",
      "   We can also regard \\((x,y) \\rightarrow (x-8,y-3)\\) as a negative move of type A, and so on.\n",
      "\n",
      "4. Set up the equations for the total movements:\n",
      "    \\[\n",
      "    8(a + c) + 3(b + d) = 19\n",
      "    \\]\n",
      "    \\[\n",
      "    3(a - c) + 8(b - d) = 0\n",
      "    \\]\n",
      "\n",
      "5. Solving these equations:\n",
      "    - Let \\( a = 5, b = -1, c = -3, d = 2 \\):\n",
      "\n",
      "    This needs verification:\n",
      "    \\[\n",
      "    8(5 - 3) + 3(-1 + 2) = 19\n",
      "    \\]\n",
      "    \\[\n",
      "    8 \\cdot 2 + 3 \\cdot 1 = 16 + 3 = 19\n",
      "    \\]\n",
      "    \\[\n",
      "    3(5 + 3) + 8(-1 - 2) = 0\n",
      "    \\]\n",
      "    \\[\n",
      "    3 \\cdot 8 + 8 \\cdot -3 = 24 - 24 = 0\n",
      "    \\]\n",
      "\n",
      "The solution is valid, and the sequence of moves is:\n",
      "    \\[\n",
      "    (0,0) \\to (8,3) \\to (16,6) \\to (8,9) \\to (11,1) \\to (19,4) \\to (11,7) \\to (19,10) \\to (16,2) \\to (8,5) \\to (16,8) \\to (19,0)\n",
      "    \\]\n",
      "\n",
      "Thus the task is possible for \\( r = 73 \\).\n",
      "\n",
      "\\[\n",
      "\\blacksquare\n",
      "\\]\n",
      "\n",
      "#### Part (c):\n",
      "Determine if the task can be done for \\( r = 97 \\).\n",
      "\n",
      "1. If \\( r = 97 \\), then we have:\n",
      "    \\[\n",
      "    a^2 + b^2 = 97\n",
      "    \\]\n",
      "    Noting that:\n",
      "    \\[\n",
      "    9^2 + 4^2 = 81 + 16 = 97\n",
      "    \\]\n",
      "\n",
      "   The potential moves are \\((9,4)\\), \\((4,9)\\), \\((9,-4)\\), \\((4,-9)\\), and their corresponding negatives.\n",
      "\n",
      "2. To determine the movement being impossible:\n",
      "   - Consider moves that change \\( y \\) by 4 as \"toggle moves\".\n",
      "   - Central strip: \\( y = 4, 5, 6, 7 \\).\n",
      "\n",
      "   **Toggle Analysis**:\n",
      "   - Toggle moves toggle in and out of the strip, change the parity of the \\( x \\)-coordinate, non-toggle do not.\n",
      "   - Start and finish out of the strip (y = 0).\n",
      "\n",
      "3. At \\((0,0)\\) and \\((19,0)\\):\n",
      "   - Need even number of toggle moves to stay non-included.\n",
      "   - Start even x, finish odd x, need an odd number of toggle moves.\n",
      "\n",
      "**Contradiction**:\n",
      "- Even and odd number of toggle moves needed simultaneously is contradictory, thus the task is impossible for \\( r = 97 \\).\n",
      "\n",
      "\\[\n",
      "\\blacksquare\n",
      "\\]\n",
      "71000\n",
      "72000\n",
      "73000\n",
      "Is there any irrational number \\( c \\) in the interval \\( (0,1) \\) such that neither the decimal digits of \\( c \\) nor the decimal digits of \\( \\sqrt{c} \\) contain a 0?\n",
      "### Problem:\n",
      "Is there an irrational number \\( c \\) in the interval \\( (0,1) \\) such that neither the decimal digits of \\( c \\) nor that of \\( \\sqrt{c} \\) contain the digit 0?\n",
      "\n",
      "\n",
      "#### I. Solution\n",
      "\n",
      "1. **Introduction:** \n",
      "   We are looking for an irrational number \\( c \\) in \\( (0,1) \\) such that both \\( c \\) and \\( \\sqrt{c} \\) do not have the digit 0 in their decimal expansions. Let's start with \\( \\sqrt{c} = \\frac{1}{3} = 0.333\\ldots \\).\n",
      "\n",
      "2. **Calculation of \\(c\\):**\n",
      "   \\[\n",
      "   c = \\left(\\frac{1}{3}\\right)^2 = \\frac{1}{9} = 0.111\\ldots\n",
      "   \\]\n",
      "   Here, neither \\( c \\) nor \\( \\sqrt{c} \\) contains the digit 0.\n",
      "\n",
      "3. **Perturbing \\( \\sqrt{c} \\):**\n",
      "   We seek to modify \\( \\sqrt{c} \\) slightly such that it remains in the interval \\( (0,1) \\) and becomes irrational, while still not containing the digit 0. Consider:\n",
      "   \\[\n",
      "   \\sqrt{c} = \\frac{1}{3} + 6 \\sum_{k=1}^{\\infty} 10^{-a_{k}}\n",
      "   \\]\n",
      "   where \\( \\left(a_k\\right) \\) is an increasing sequence of distinct positive integers such that the digits in \\( \\sqrt{c} \\) are only 3 and 9.\n",
      "\n",
      "4. **Determining the series expansion for \\( c \\):**\n",
      "   Using the perturbation, we need to calculate:\n",
      "   \\[\n",
      "   \\begin{aligned}\n",
      "   c &= \\left( \\frac{1}{3} + 6 \\sum_{k=1}^{\\infty} 10^{-a_k} \\right)^2 \\\\\n",
      "   &= \\frac{1}{9} + 36 \\sum_{k=1}^{\\infty} 10^{-2a_k} + 4 \\sum_{k=1}^{\\infty} 10^{-a_k} + 72 \\sum_{1 \\leq k < l} 10^{-(a_k + a_l)}\n",
      "   \\end{aligned}\n",
      "   \\]\n",
      "\n",
      "5. **Ensuring non-zero digits:**\n",
      "   Selecting \\( \\left(a_k\\right) = \\left(6^k\\right) \\), we ensure the series expansion contains digits that are non-zero and non-periodic:\n",
      "   \\[\n",
      "   c = \\frac{1}{9} + \\text{(additional terms ensuring non-periodicity and non-zero digits)}\n",
      "   \\]\n",
      "\n",
      "6. **Validation:**\n",
      "   Since \\( \\left(a_k\\right) \\) grows rapidly, the decimal expansion of \\( c \\) avoids the digit 0 and does not show periodic behavior.\n",
      "\n",
      "#### II. Solution\n",
      "\n",
      "1. **Cantor’s Diagonal Argument:**\n",
      "   Consider the set \\( H \\) of square roots of all rational numbers in \\( (0,1) \\). These are countable, and we list them as:\n",
      "   \\[\n",
      "   0.a_{11} a_{12} a_{13} \\ldots, 0.a_{21} a_{22} a_{23} \\ldots, \\ldots\n",
      "   \\]\n",
      "\n",
      "2. **Constructing the Desired Decimal Expansion:**\n",
      "   Define a new number \\( d = 0.b_1 b_2 b_3 \\ldots \\) such that:\n",
      "   \\[\n",
      "   b_n = \\begin{cases}\n",
      "   5 & \\text{if } a_{nn} \\neq 5 \\\\\n",
      "   6 & \\text{if } a_{nn} = 5 \\\\\n",
      "   7 & \\text{if } a_{nn} = 6\n",
      "   \\end{cases}\n",
      "   \\]\n",
      "\n",
      "3. **Ensuring Properties:**\n",
      "   - \\( d \\) differs from each \\( 0.a_{1*} \\), \\( 0.a_{2*} \\), etc., at the nth digit position, ensuring \\( d \\notin H \\).\n",
      "   - The decimal digits of \\( d \\) are neither 0 nor periodic.\n",
      "\n",
      "4. **Defining \\( c = d^2 \\):**\n",
      "   Let \\( c = d^2 \\). Then:\n",
      "   \\[\n",
      "   d \\notin H \\implies c \\text{ is irrational.}\n",
      "   \\]\n",
      "\n",
      "5. **Validation:**\n",
      "   - Both \\( c \\) and \\( d \\)’s decimal expansions contain no 0.\n",
      "   - As \\( d \\)’s digits are \\( \\{5, 6, 7, 8\\} \\), and \\( d \\) is not in \\( H \\), \\( d \\) is irrational.\n",
      "   - Thus, the digits of \\( c \\) do not include 0, and \\( c \\) fits within \\( (0,1) \\).\n",
      "\n",
      "### Conclusion:\n",
      "There exists an irrational number \\( c \\) in \\( (0,1) \\) such that neither \\( c \\) nor \\( \\sqrt{c} \\) contains the digit 0 in their decimal expansions. \\(\\boxed{}\\)\n",
      "74000\n",
      "75000\n",
      "76000\n",
      "77000\n",
      "78000\n",
      "79000\n",
      "80000\n",
      "81000\n",
      "82000\n",
      "83000\n",
      "84000\n",
      "85000\n",
      "86000\n",
      "87000\n",
      "88000\n",
      "89000\n",
      "90000\n",
      "91000\n",
      "92000\n",
      "93000\n",
      "94000\n",
      "95000\n",
      "96000\n",
      "97000\n",
      "98000\n"
     ]
    }
   ],
   "source": [
    "# Have gemini add the solutions to the numina dataset.\n",
    "# Filter for non-proof problems.\n",
    "import concurrent.futures\n",
    "from concurrent.futures import as_completed\n",
    "\n",
    "from rllm.system_prompts import EXTRACT_SOLUTION_PROMPT\n",
    "\n",
    "\n",
    "def get_answer(entry):\n",
    "    # 1) Get the problem text\n",
    "    problem_text = entry[\"problem\"]\n",
    "    solution_text = entry[\"solution\"]\n",
    "    # 2) Call Gemini LLM\n",
    "    output_list = call_gemini_llm(f\"Problem: {problem_text} \\n----\\n Solution: {solution_text}\", system_prompt=EXTRACT_SOLUTION_PROMPT, n=3)\n",
    "    output_list = [o for o in output_list if \"error\" not in o and \"Error\" not in o and \"Solution not found\" not in o]\n",
    "    if not output_list:\n",
    "        print(problem_text)\n",
    "        print(solution_text)\n",
    "        return None\n",
    "\n",
    "    for output_str in output_list:\n",
    "        if \"answer\" in entry:\n",
    "            if output_str in entry[\"answer\"]:\n",
    "                continue\n",
    "            entry[\"answer\"].append(output_str)\n",
    "        else:\n",
    "            entry[\"answer\"] = [output_str]\n",
    "    return entry\n",
    "\n",
    "\n",
    "results = []\n",
    "idx = 0\n",
    "with concurrent.futures.ThreadPoolExecutor(max_workers=32) as executor:\n",
    "    # 1) Submit all jobs to the executor\n",
    "    futures = [executor.submit(get_answer, entry) for entry in olympiad]\n",
    "    # 2) Process them as they complete, using tqdm for a progress bar\n",
    "    for future in as_completed(futures):\n",
    "        # Get the result for each completed future\n",
    "        result = future.result()\n",
    "        if result:\n",
    "            results.append(result)\n",
    "        if idx % 1000 == 0:\n",
    "            print(idx)\n",
    "            with open(\"olympiad_checkpoint.json\", \"w\") as f:\n",
    "                json.dump(results, f, indent=2)\n",
    "        idx += 1\n",
    "\n",
    "# Save final list as json\n",
    "with open(\"olympiad_no_proof.json\", \"w\") as f:\n",
    "    json.dump(results, f, indent=2)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "rllm",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
